package com.xiaotao.usercenterbackend.controller;

import com.xiaotao.usercenterbackend.model.domain.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {

    @PostMapping("/test")
    public String test(User user) {

        System.out.println(user.getUsername());
        return user.getUsername();
    }

    @PostMapping("/test1")
    public String test1(String username) {

        System.out.println(username);
        return username;
    }

    @PostMapping("/test2")
    public String test2(@RequestParam List<String> username) {

        username.forEach(System.out::println);

        System.out.println(username);
        return username.toString();
    }
}
